import unittest
from HTMLTestRunner.HTMLTestRunner import HTMLTestRunner
from email.mime.multipart import MIMEMultipart



# 2.扫描刚才的4条用例
tests = unittest.defaultTestLoader.discover(r"D:\Users\北极星的眼泪\Desktop\demo\单元测试第二天",pattern="Test_*.py")

# 3.执行并生成测试报告
# HTMLTestRunner

runner = HTMLTestRunner(
    title = "这是计算器报告",
    description="这是计算器四则运算报告",
    verbosity=2,# 详细程度
    stream = open(file="计算器.html",mode="w+",encoding="utf-8")
)

runner.run(tests)